<?php
/* @var $this PostController */
/* @var $model Post */
/* @var $form CActiveForm */
?>
<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<div class="box">
	<div class="box-title">
		<h4>Advanced Search</h4>
	</div>
	<div class="box-content">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>Yii::app()->createUrl($this->route),
			'method'=>'get',
			'htmlOptions' => array('class'=>'form-horizontal')
		)); ?>

		<div class="control-group">
			<?php echo $form->label($model,'title', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>200)); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->label($model,'rating', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'rating', $model->getRatingListData(), array('empty'=>'')); ?>
				<?php echo $form->error($model,'rating'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->label($model,'status', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model, 'status', $model->getStatusListData(), array('empty'=>'') ); ?>
				<?php echo $form->error($model,'status'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'visibility', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'visibility', $model->getVisibilityListData(), array('empty'=>'')); ?>
				<?php echo $form->error($model,'visibility'); ?>
			</div>
		</div>
		
		<div class="control-group">
			<?php echo $form->label($model,'category_id', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'category_id', $model->getCategoryListData(), array('encode'=>false,'empty'=>'')); ?>
				<?php echo $form->error($model,'category_id'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->label($model,'created_time', array('class'=>'control-label')); ?>
			<div class="controls">
				<p>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $model,
					'attribute'=>'created_time_from',
					'options'=>array('dateFormat'=>'yy-mm-dd'),
					'htmlOptions'=>array('placeHolder'=>'From'),
				));
				?>
				</p>

				<p>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $model,
					'attribute'=>'created_time_to',
					'options'=>array('dateFormat'=>'yy-mm-dd'),
					'htmlOptions'=>array('placeHolder'=>'To'),
				));
				?>
				</p>
				<?php echo $form->error($model,'created_time'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->label($model,'updated_time', array('class'=>'control-label')); ?>
			<div class="controls">
				<p>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $model,
					'attribute'=>'updated_time_from',
					'options'=>array('dateFormat'=>'yy-mm-dd'),
					'htmlOptions'=>array('placeHolder'=>'From'),
				));
				?>
				</p>

				<p>
				<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
					'model' => $model,
					'attribute'=>'updated_time_to',
					'options'=>array('dateFormat'=>'yy-mm-dd'),
					'htmlOptions'=>array('placeHolder'=>'To'),
				));
				?>
				</p>
				<?php echo $form->error($model,'updated_time'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'tags', array('class'=>'control-label')); ?>
			<div class="controls">
				<div class="tags-container span5">
				<?php echo $form->checkBoxList($model, 'tags', Tag::model()->getListData(), array(
					'separator'=>'', 
					'template'=>'<div class="chk">{input} {label}</div>',
					'container'=>'div'
				)); ?>
				</div>
			</div>
		</div>

		<div class="control-group">
			<div class="controls">
				<?php echo CHtml::submitButton('Search', array('class'=>'btn')); ?>
			</div>
		</div>

		<?php $this->endWidget(); ?>
	</div>
</div>

